package org.javatribe.calculator.module.handler;

import org.javatribe.calculator.common.EventWrapper;
import org.javatribe.calculator.common.Handler;
import org.javatribe.calculator.module.view.IndexFrame;

/**
 * Created by Wenxin on 2017/9/16.
 */
public class ProccessExitHandler implements Handler {
    @Override
    public void handle(EventWrapper eventWrapper) {
        eventWrapper.proccess();
        IndexFrame indexFrame = (IndexFrame) eventWrapper.getFrame();
        if (eventWrapper.getEvent().getSource().equals(indexFrame.getOFF_BUTTON())){
           System.exit(0);
        }
    }
}
